<?php

/*
 * Edit by shengxin
 * Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
 */

namespace api\mall\task;

/**
 * 连续登录任务
 *
 * @author PC
 */
class AccumulateLogin extends TaskChecker{


    protected function check($task_data, $cfg):bool {
        return $cfg['task_req']<=$task_data;
    }
    
    protected function queryTaskData($user):int {
        $model = new \api\mall\model\DailyTaskModel();
        $count = $model->where('user_id',$user->id)->group('date')->count();
        return $count;
    }
}
